<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <title>菜单用法</title>
    <link rel="stylesheet" href="../stylesheets/common.css" />
    <link rel="stylesheet" href="../stylesheets/table.css" />
    <style>

    </style>
</head>

<body>
    <div class="place">
        <span class="label-span">位置：</span>
        <span></span>
    </div>
    <div class="body-warp clearfix">
        <!-- tree-list 树导航 tree-content树内容-->
        <!-- tree-list 树列表两种展现方式 -->
        <!-- 1.美观滚动条，固定宽度，展开超过长度时省略号表示，悬浮显示全部文字提示，可自定义固定宽度 ,必在要素：嵌套在DIV里，tree-list-scroll类名，nicescroll插件及初始化（初始化时请放置于最后），封装函数createTreeScroll()-->
        <div class="tree-list-scroll ztree panel p-10">
            <ul id="treeList">
            </ul>
        </div>
        <!-- 1.浏览器默认滚动条，根据右侧树列表项长度自动调整右侧内容区尺寸,必在要素：tree-list类名，封装函数createTree()-->
        <!--<ul id="treeList" class="tree-list ztree panel p-10">
            </ul>-->
        <div id="treeContent" class="tree-content">
            <div id="panelView" class="panel panelview"></div>
            <table class="table" id="table"></table>
        </div>
    </div>
    <script type="text/javascript" src="../ext/jquery/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="../ext/jquery/selectbox.js"></script>
    <script type="text/javascript" src="../ext/layer/layer.min.js"></script>
    <script type="text/javascript" src="../ext/zw/grid.js"></script>
    <script type="text/javascript" src="../ext/zw/src/jquery-epaging.js"></script>
    <script type="text/javascript" src="../javascripts/tool.js?v=1.3"></script>
    <script type="text/javascript" src="../ext/zTree/js/jquery.ztree.core-3.5.min.js"></script>
    <script type="text/javascript" src="../ext/layer_v2/layer.js"></script>
    <link rel="stylesheet" href="../ext/zTree/css/zTreeStyle/zTree.css" type="text/css">
    <script type="text/javascript" src="../ext/zw/lui/common.js"></script>
    <script type="text/javascript" src="../ext/zw/lui/luicontroller.js?v=1"></script>
    <script type="text/javascript" src="../ext/zw/lui/droplist.js"></script>
    <script type="text/javascript" src="../ext/zw/lui/panelview.js"></script>
    <script type="text/javascript" src="../ext/jquery/jquery.nicescroll.min.js"></script>
    <script>
    var _temp = [];
    $

    $(function() {


        //设置默认参数
        var _t0 = $('#hid_names',window.parent.document).val() != undefined ? $('#hid_names',window.parent.document).val() : '' ,
            _t1 = $('#hid_ids',window.parent.document).val() != undefined ? $('#hid_ids',window.parent.document).val() : '';
        
        if((_t0 != '' && _t0 != 'undefined') && (_t1 != '' && _t1 != 'undefined')){
            var _temp0 = _t0.split(','),
                _temp1 = _t1.split(',');
            for(var i=0,l=_temp0.length;i<l;i++){
                var _obj = {};
                _obj.id = _temp1[i];
                _obj.name = _temp0[i];
               _temp.push(_obj); 
            };    
        };

        //联动初始化对象
        var obj = {};
        obj.gridData = {
            url:'data-mul.json',
            type:'get'
        }
        obj.columns = [{
            title: '字典值',
            dataIndex: 'unit',
        }, {
            title: '项目列表',
            dataIndex: 'sex'
        }, {
            title: '是否系统值',
            dataIndex: 'role',
            renderer: function(cellData, rowData, grid, cellIndex, rowIndex) {
                setTimeout(function(){
                    for(var i=0,l=_temp.length;i<l;i++){
                        if(_temp[i].id == rowData.id){
                            grid.selectRecord(rowIndex);
                            break;
                        };
                    };    
                },0);
                roleValue = cellData == 2 ? '是' : '否';
                return '<span class="red">' + roleValue + '</span>';
            }
        }];
        obj.gridTarget = $('#table');
        obj.panelTarget = $("#panelView");
        obj.tempList = _temp;
        obj.autoClose = true;
        obj.showName = 'phone'
        obj.outer = function(ob){
            window.parent.outerMul(ob);
        };

        var grid = gridPanelviewAdv(obj);

        /* 初始化控件 */
        initWidget();

        //初始化树（树的初始化要放在最后）
        initTree();

        console.log(grid.load)

    });



    /*初始化树*/
    function initTree() {

        //初始化树
        var setting = {

        };

        var zNodes = [{
            name: "所有字典",
            open: true,
            children: [{
                name: "单位锭虹夺三基类型",
                children: [{
                    name: "叶子基震点12震点12震点12震点",
                    children: [{
                        name: "叶子节点苦角苦基无苦角苦基无苦角苦基无苦角苦基无苦角苦基无可奈何无可奈何无可奈何无可奈何节震左"
                    }, {
                        name: "叶子节点122"
                    }, {
                        name: "叶子节点123"
                    }, {
                        name: "叶子节点124"
                    }]
                }, {
                    name: "叶子节点122"
                }, {
                    name: "叶子节点123"
                }, {
                    name: "叶子节点124"
                }]

            }, {
                name: "单位锭虹夺三基类型",
                children: [{
                    name: "叶子基震点12震点12震点12震点",
                    children: [{
                        name: "叶子节点苦角苦基无苦角苦基无苦角苦基无苦角苦基无苦角苦基无可奈何无可奈何无可奈何无可奈何节震左"
                    }, {
                        name: "叶子节点122"
                    }, {
                        name: "叶子节点123"
                    }, {
                        name: "叶子节点124"
                    }]
                }, {
                    name: "叶子节点122"
                }, {
                    name: "叶子节点123"
                }, {
                    name: "叶子节点124"
                }]

            }, {
                name: "单位锭虹夺三基类型",
                children: [{
                    name: "叶子基震点12震点12震点12震点",
                    children: [{
                        name: "叶子节点苦角苦基无苦角苦基无苦角苦基无苦角苦基无苦角苦基无可奈何无可奈何无可奈何无可奈何节震左"
                    }, {
                        name: "叶子节点122"
                    }, {
                        name: "叶子节点123"
                    }, {
                        name: "叶子节点124"
                    }]
                }, {
                    name: "叶子节点122"
                }, {
                    name: "叶子节点123"
                }, {
                    name: "叶子节点124"
                }]

            }, {
                name: "办学性质",

            }, {
                name: "性别",
            }, ]
        }, {
            name: "所有字典",
            open: true,
            children: [{
                name: "单位锭虹夺三基类型",
                children: [{
                    name: "叶子基震点12震点12震点12震点",
                    children: [{
                        name: "叶子节点苦角苦基无苦角苦基无苦角苦基无苦角苦基无苦角苦基无可奈何无可奈何无可奈何无可奈何节震左"
                    }, {
                        name: "叶子节点122"
                    }, {
                        name: "叶子节点123"
                    }, {
                        name: "叶子节点124"
                    }]
                }, {
                    name: "叶子节点122"
                }, {
                    name: "叶子节点123"
                }, {
                    name: "叶子节点124"
                }]

            }, {
                name: "单位锭虹夺三基类型",
                children: [{
                    name: "叶子基震点12震点12震点12震点",
                    children: [{
                        name: "叶子节点苦角苦基无苦角苦基无苦角苦基无苦角苦基无苦角苦基无可奈何无可奈何无可奈何无可奈何节震左"
                    }, {
                        name: "叶子节点122"
                    }, {
                        name: "叶子节点123"
                    }, {
                        name: "叶子节点124"
                    }]
                }, {
                    name: "叶子节点122"
                }, {
                    name: "叶子节点123"
                }, {
                    name: "叶子节点124"
                }]

            }, {
                name: "单位锭虹夺三基类型",
                children: [{
                    name: "叶子基震点12震点12震点12震点",
                    children: [{
                        name: "叶子节点苦角苦基无苦角苦基无苦角苦基无苦角苦基无苦角苦基无可奈何无可奈何无可奈何无可奈何节震左"
                    }, {
                        name: "叶子节点122"
                    }, {
                        name: "叶子节点123"
                    }, {
                        name: "叶子节点124"
                    }]
                }, {
                    name: "叶子节点122"
                }, {
                    name: "叶子节点123"
                }, {
                    name: "叶子节点124"
                }]

            }, {
                name: "办学性质",

            }, {
                name: "性别",
            }, ]
        }, {
            name: "所有字典",
            open: true,
            children: [{
                name: "单位锭虹夺三基类型",
                children: [{
                    name: "叶子基震点12震点12震点12震点",
                    children: [{
                        name: "叶子节点苦角苦基无苦角苦基无苦角苦基无苦角苦基无苦角苦基无可奈何无可奈何无可奈何无可奈何节震左"
                    }, {
                        name: "叶子节点122"
                    }, {
                        name: "叶子节点123"
                    }, {
                        name: "叶子节点124"
                    }]
                }, {
                    name: "叶子节点122"
                }, {
                    name: "叶子节点123"
                }, {
                    name: "叶子节点124"
                }]

            }, {
                name: "单位锭虹夺三基类型",
                children: [{
                    name: "叶子基震点12震点12震点12震点",
                    children: [{
                        name: "叶子节点苦角苦基无苦角苦基无苦角苦基无苦角苦基无苦角苦基无可奈何无可奈何无可奈何无可奈何节震左"
                    }, {
                        name: "叶子节点122"
                    }, {
                        name: "叶子节点123"
                    }, {
                        name: "叶子节点124"
                    }]
                }, {
                    name: "叶子节点122"
                }, {
                    name: "叶子节点123"
                }, {
                    name: "叶子节点124"
                }]

            }, {
                name: "单位锭虹夺三基类型",
                children: [{
                    name: "叶子基震点12震点12震点12震点",
                    children: [{
                        name: "叶子节点苦角苦基无苦角苦基无苦角苦基无苦角苦基无苦角苦基无可奈何无可奈何无可奈何无可奈何节震左"
                    }, {
                        name: "叶子节点122"
                    }, {
                        name: "叶子节点123"
                    }, {
                        name: "叶子节点124"
                    }]
                }, {
                    name: "叶子节点122"
                }, {
                    name: "叶子节点123"
                }, {
                    name: "叶子节点124"
                }]

            }, {
                name: "办学性质",

            }, {
                name: "性别",
            }, ]
        }, {
            name: "所有字典",
            open: true,
            children: [{
                name: "单位锭虹夺三基类型",
                children: [{
                    name: "叶子基震点12震点12震点12震点",
                    children: [{
                        name: "叶子节点苦角苦基无苦角苦基无苦角苦基无苦角苦基无苦角苦基无可奈何无可奈何无可奈何无可奈何节震左"
                    }, {
                        name: "叶子节点122"
                    }, {
                        name: "叶子节点123"
                    }, {
                        name: "叶子节点124"
                    }]
                }, {
                    name: "叶子节点122"
                }, {
                    name: "叶子节点123"
                }, {
                    name: "叶子节点124"
                }]

            }, {
                name: "单位锭虹夺三基类型",
                children: [{
                    name: "叶子基震点12震点12震点12震点",
                    children: [{
                        name: "叶子节点苦角苦基无苦角苦基无苦角苦基无苦角苦基无苦角苦基无可奈何无可奈何无可奈何无可奈何节震左"
                    }, {
                        name: "叶子节点122"
                    }, {
                        name: "叶子节点123"
                    }, {
                        name: "叶子节点124"
                    }]
                }, {
                    name: "叶子节点122"
                }, {
                    name: "叶子节点123"
                }, {
                    name: "叶子节点124"
                }]

            }, {
                name: "单位锭虹夺三基类型",
                children: [{
                    name: "叶子基震点12震点12震点12震点",
                    children: [{
                        name: "叶子节点苦角苦基无苦角苦基无苦角苦基无苦角苦基无苦角苦基无可奈何无可奈何无可奈何无可奈何节震左"
                    }, {
                        name: "叶子节点122"
                    }, {
                        name: "叶子节点123"
                    }, {
                        name: "叶子节点124"
                    }]
                }, {
                    name: "叶子节点122"
                }, {
                    name: "叶子节点123"
                }, {
                    name: "叶子节点124"
                }]

            }, {
                name: "办学性质",

            }, {
                name: "性别",
            }, ]
        }, {
            name: "所有字典",
            open: true,
            children: [{
                name: "单位锭虹夺三基类型",
                children: [{
                    name: "叶子基震点12震点12震点12震点",
                    children: [{
                        name: "叶子节点苦角苦基无苦角苦基无苦角苦基无苦角苦基无苦角苦基无可奈何无可奈何无可奈何无可奈何节震左"
                    }, {
                        name: "叶子节点122"
                    }, {
                        name: "叶子节点123"
                    }, {
                        name: "叶子节点124"
                    }]
                }, {
                    name: "叶子节点122"
                }, {
                    name: "叶子节点123"
                }, {
                    name: "叶子节点124"
                }]

            }, {
                name: "单位锭虹夺三基类型",
                children: [{
                    name: "叶子基震点12震点12震点12震点",
                    children: [{
                        name: "叶子节点苦角苦基无苦角苦基无苦角苦基无苦角苦基无苦角苦基无可奈何无可奈何无可奈何无可奈何节震左"
                    }, {
                        name: "叶子节点122"
                    }, {
                        name: "叶子节点123"
                    }, {
                        name: "叶子节点124"
                    }]
                }, {
                    name: "叶子节点122"
                }, {
                    name: "叶子节点123"
                }, {
                    name: "叶子节点124"
                }]

            }, {
                name: "单位锭虹夺三基类型",
                children: [{
                    name: "叶子基震点12震点12震点12震点",
                    children: [{
                        name: "叶子节点苦角苦基无苦角苦基无苦角苦基无苦角苦基无苦角苦基无可奈何无可奈何无可奈何无可奈何节震左"
                    }, {
                        name: "叶子节点122"
                    }, {
                        name: "叶子节点123"
                    }, {
                        name: "叶子节点124"
                    }]
                }, {
                    name: "叶子节点122"
                }, {
                    name: "叶子节点123"
                }, {
                    name: "叶子节点124"
                }]

            }, {
                name: "办学性质",

            }, {
                name: "性别",
            }, ]
        }];
        //全局性树列，默认使用id名为#treeList；树内容区默认使用ID名使用#treeContent，两者绑定，折叠展开树列时，树内容自适应窗口布局
        //当一个页面出现多个树列时，其他树列使用非#treeList名称，如果*还想*绑定树内容自适应窗口，请在setting里的view里绑定treeContentId的ID名称
        //
        /*
                    var treeObj = $("#treeList").createTree(setting, zNodes);
        */
        var treeObj = $("#treeList").createTreeScroll(setting, zNodes);

    }


    /*初始化控件*/
    function initWidget() {

        //初始化树滚动条
        $('.tree-list-scroll').niceScroll({
            cursorcolor: '#7db7fb',
            cursorwidth: '6px',
            cursorborderradius: 2,
            autohidemode: true,
            background: '#d0d0d0',
            cursoropacitymin: 1,
            cursorborder: 'none',
            horizrailenabled: true
        });
    }
    </script>
</body>

</html>
